/*
 * @Author: lys
 * @Description: 
 * @Date: 2024-02-22 19:10:50
 * @LastEditors: lys
 * @LastEditTime: 2024-05-12 01:51:47
 */

//提供带 Content-Encoding 编码的压缩版的资源
const CompressionPlugin = require("compression-webpack-plugin");

module.exports = {
  //publicPath: './',//测试服务器修改
  publicPath: '/grade-evaluation-declaration',
  outputDir: 'declaration',
  devServer: {
    port: 8080,
    compress: true,
    // 开发时，使用local配置，反向代理
    proxy: {
      '/grade-evaluation-api': {
        target: 'https://pinggu.mkcom.cn/grade-evaluation-api',
        // target: 'https://gpytest.loca.lt/',
        // target: 'http://124.70.184.139/grade-evaluation-api',
        // target: 'http://192.168.10.40:8091',
        changeOrigin: true,
         pathRewrite: {
           '^/grade-evaluation-api': ''
         }
      },
      '/grade-evaluation-file': {
        target: 'https://pinggu.mkcom.cn/grade-evaluation-file',
        // target: 'https://gpytest.loca.lt',
        // target: 'http://124.70.184.139/grade-evaluation-api',
        // target: 'http://192.168.10.40:8091',
        changeOrigin: true,
         pathRewrite: {
           '^/grade-evaluation-file': ''
         }
      }
    }
  },
  // configureWebpack: () => {
  //   if (process.env.NODE_ENV === "production") {
  //     //生产环境时使用
  //     return {
  //       plugins: [
  //         new CompressionPlugin({//提供带 Content-Encoding 编码的压缩版的资源
  //           test: /\.js$|\.html$|\.css/,
  //           threshold: 1024,
  //           deleteOriginalAssets: false,
  //         }),
  //       ],
  //     };
  //   }
  // },
  productionSourceMap: false,
  lintOnSave: false,
};
